package fr.udata.client.view.impl;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Widget;

import fr.udata.client.service.UserService;
import fr.udata.client.service.UserServiceAsync;
import fr.udata.client.view.SigninView;

public class SigninViewImpl extends Composite implements SigninView {

	private static SigninViewUiBinder uiBinder = GWT
			.create(SigninViewUiBinder.class);
	private final UserServiceAsync service = GWT.create(UserService.class);
	private Presenter presenter;
    private String name;


	interface SigninViewUiBinder extends UiBinder<Widget, SigninViewImpl> {
	}

	public SigninViewImpl() {
		initWidget(uiBinder.createAndBindUi(this));
	}

	@UiField
	Button signinButton;
	@UiField
	TextBox emailTextbox;
	@UiField
	TextBox passwordTextbox;

	@UiHandler("signinButton")
	void onClick(ClickEvent e) {
		String email = emailTextbox.getText();
		String password = passwordTextbox.getText();

	}

	private Boolean verifyEmail(String email) {
		return true;
	}

	private Boolean verifyPassword() {
		return true;
	}

	@Override
	public void setName(String name) {
        this.name = name;

	}

	@Override
	public void setPresenter(Presenter presenter) {
		this.presenter = presenter;
	}

}
